Fall 2016 CMSC 420 Hanan Samet Programming Assignment

نویسنده

  • Hanan Samet
چکیده

In this assignment you are required to implement an information management system for handling data similar to that used in VLSI (very large scale integration) as well as game programming applications. In such an environment the primary entities are small rectangles and the problem in which we are interested is how to manage a large collection of them. In the following we trace the development of a variant of the quadtree data structure that has been found to be useful for such a problem. Your task is to implement this data structure in such a way that a number of operations can be efficiently handled. An example JAVA applet for the data structure can be found on the home page of the class. This assignment is divided into four parts. C, C++, or PASCAL are the permitted programming languages. JAVA is not permitted. Also, you are not allowed to make use of any built in data structures from any library such as, but not limited to, STL in C++. For the first two parts, you must read the attached description of the problem and data structure. A detailed explanation of the assignment including the specification of the operations which you are to implement is found at the end of the description. After you have done this, you are to turn in a proposed implementation of the data structure using C++ classes, C structs, or PASCAL record definitions. One week later you must turn in a C++, C, or PASCAL program for the command decoder (i.e., scanner for the commands corresponding to the operations which are to be performed on the data structure). For the third part, you are to write a C++, C, or PASCAL program to implement the data structure and operations (1)-(9). For the fourth part, you are to implement operations (10)–(14). Operations (15)–(18) are optional and you will get extra credit if you turn them in with part four. If you are a graduate student, part four is not optional. 1Copyright c ©2016 by Hanan Samet. No part of this document may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the express prior permission of the author. 1 Region-Based Quadtrees The quadtree is a member of a class of hierarchical data structures that are based on the principle of recursive decomposition. As an example, consider the point quadtree of Finkel and Bentley [2] which should be familiar to you as it is simply a multidimensional generalization of a binary search tree. In two dimensions each node has four subtrees corresponding to the directions NW, NE, SW, and SE. Each subtree is commonly referred to as a quadrant or subquadrant. For example, see Figure 1.142 where a point quadtree of 8 nodes is presented. In our presentation we shall only discuss two-dimensional quadtrees although it should be clear that what we say can be easily generalized to more than two dimensions. For the point quadtree the points of decomposition are the data points themselves (i.e., in Figure 1.14, Chicago at location (35,40) subdivides the two dimensional space into four rectangular regions). Requiring the regions to be of equal size leads to the region quadtree of Klinger [6, 8, 7]. This data structure was developed for representing homogeneous spatial data and is used in computer graphics, image processing, geographical information systems, pattern recognition, and other applications. For a history and review of the quadtree representation, see pp. 28–48 and 423–426 in [9]. As an example of the region quadtree, consider the region shown in Figure 1.28a which is represented by a 23 ×23 binary array in Figure 1.28b. Observe that 1’s correspond to picture elements (termed pixels) which are in the region and 0’s correspond to picture elements that are outside the region. The region quadtree representation is based on the successive subdivision of the array into four equal-size quadrants. If the array does not consist entirely of 1’s or 0’s (i.e., the region does not cover the entire array), then we subdivide it into quadrants, subquadrants, ... until we obtain blocks (possibly single pixels) that consist entirely of 1’s or entirely of 0’s. For example, the resulting blocks for the region of Figure 1.28b are shown in Figure 1.28c. This process is represented by a quadtree in which the root node corresponds to the entire array, the four sons of the root node represent the quadrants, and the leaf nodes correspond to those blocks for which no further subdivision is necessary. Leaf nodes are said to be BLACK or WHITE depending on whether their corresponding blocks are entirely within or outside of the region respectively. All non-leaf nodes are said to be GRAY. The region quadtree for Figure 1.28c is shown in Figure 1.28d.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Fall 2007 CMSC 420 Hanan Samet Programming Assignment 1 : A Data Structure For Game Programming

In this assignment you are required to implement a system for handling data similar to that used in game programming. In such an environment the primary entities are polygons and the problem we are interested is how to manage a large collection of them. In this assignment, we will restrict input to a collection of small rectangles. In the following we trace the development of a variant of the q...

متن کامل

Fall 2011 CMSC 420 Hanan Samet Programming Assignment 1 : A Data Structure For Game Programming

In this assignment you are required to implement a system for handling data similar to that used in game programming. In such an environment the primary entities are small rectangles and the problem we are interested is how to manage a large collection of them. In the following we trace the development of a variant of the quadtree data structure that has been found to be useful for such problem...

متن کامل

Fall 2012 CMSC 420 Hanan Samet Programming Assignment 1 : A Data Structure For VLSI Applications

In this assignment you are required to implement an information management system for handling data similar to that used in VLSI (very large scale integration) as well as game programming applications. In such an environment the primary entities are small rectangles and the problem in which we are interested is how to manage a large collection of them. In the following we trace the development ...

متن کامل

Fall 2010 CMSC 420 Hanan Samet Programming Assignment 1 : A Data Structure For VLSI Applications

In this assignment you are required to implement an information management system for handling data similar to that used in VLSI (very large scale integration) applications. In such an environment the primary entities are small rectangles and the problem in which we are interested is how to manage a large collection of them. In the following we trace the development of a variant of the quadtree...

متن کامل

Deep and Shallow Binding: the Assignment Operation

Programming languages which use dynamic identification for free variables (i.e., nonlocal referencest are generally implemented with a deep or shallow binding variable access strategy. In this paper, variable access through the binding environment is assumed to be desirable. Given this assumption, it is demonstrated that the act of assigning values to variables may yield unexpected results for ...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2016